<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-body">
                <!-- Search -->
                <form th:id="form-data" th:action="@{/activityUser/findQuery}" th:object="${activityUser}" method="post">
                    <div class="form-group form-group-bot">
                        <label class="col-sm-1 control-label search-label">活动名称</label>
                        <div class="col-sm-3 col-search">
                            <input type="text" class="form-control" th:field="*{activityName}" th:autocomplete="off" placeholder="请输入活动名称" />
                        </div>
                        <label class="col-sm-1 control-label search-label">用户名称</label>
                        <div class="col-sm-3 col-search">
                            <input type="text" class="form-control" th:field="*{userName}" th:autocomplete="off" placeholder="请输入用户名称" />
                        </div>
                        <div class="col-sm-1 col-search-btn">
                            <button class="btn btn-sm btn-primary" type="button" onclick="loadSearchData()">查询</button>
                        </div>
                    </div>
                </form>
                <!-- Show Data -->
                <table class="table table-striped table-hover table-bordered">
                    <tr class="text-center">
                        <th class="col-sm-1">#</th>
                        <th>活动名称</th>
                        <th>用户名称</th>
                        <th>报名手机号</th>
                        <th>报名邮箱</th>
                        <th>用户工作单位</th>
                        <th>用户职位</th>
                        <th>报名编号</th>
                        <!--<th>用户身份证号码</th>-->
                        <th class="col-sm-1">状态</th>
                        <th class="col-sm-1">报名时间</th>
                        <th class="col-sm-2">操作</th>
                    </tr>
                    <tbody>
                        <tr th:each="obj,stat : ${data}">
                            <td th:text="${stat.count}"></td>
                            <td th:text="${obj.activityName}"></td>
                            <td th:text="${obj.userName}"></td>
                            <td th:text="${obj.userPhone}"></td>
                            <td th:text="${obj.userEmail}"></td>
                            <td th:text="${obj.userWork}"></td>
                            <td th:text="${obj.userPosition}"></td>
                            <td th:text="${obj.userNumber}"></td>
                            <!--<td th:text="${obj.userIdNumber}"></td>-->
                            <td >
                                <p th:if="${obj.userStatus  == 0}">待审核</p>
                                <p th:if="${obj.userStatus  == 1}">审核未通过</p>
                                <p th:if="${obj.userStatus  == 2}">审核通过</p>
                            </td>
                            <td th:text="${#dates.format(obj.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td>
                                <div th:if="${obj.userStatus  == 0}">
                                    <button class="btn btn-sm btn-primary btn-lit left" type="button"
                                            th:onclick="'javascript:loadEditData(\'' + @{/activityUser/editStatus(id=${obj.id},status='2')} + '\')'">审核通过
                                    </button>
                                    <button class="btn btn-sm btn-primary btn-lit left" type="button"
                                            th:onclick="'javascript:loadEditData(\'' + @{/activityUser/editStatus(id=${obj.id},status='1')} + '\')'">审核不通过
                                    </button>
                                </div>
                                <div th:if="${obj.userStatus  == 2}">
                                    <button class="btn btn-sm btn-primary btn-lit left" type="button"
                                            th:onclick="'javascript:loadEditData(\'' + @{/userHonor/edit(userid=${obj.userId},activityid=${obj.activityId})} + '\')'">颁布证书
                                    </button>
                                    <button class="btn btn-sm btn-primary btn-lit left" type="button"
                                            th:onclick="'javascript:loadEditData(\'' + @{/userGame/edit(userId=${obj.userId},activityId=${obj.activityId})} + '\')'">用户胜败
                                    </button>
                                </div>
                                <button class="btn btn-sm btn-danger btn-lit left" type="button" style="margin-left: 1px;"
                                        th:onclick="'javascript:loadDeleteData(\'' + @{/activityUser/delete(id=${obj.id})} + '\')'">删除
                                </button></td>
                        </tr>
                    </tbody>
                </table>
                <div class="bottom-no-data" th:if="${data.totalPages eq 0}">对不起~没有数据~</div>
                <!-- Pagination -->
                <div th:include="~{common/pagination :: pagin}"></div>
            </div>
        </div>
    </div>
</div>

